#include "gui_gloab.h"
#include "gui_func.h"

LV_EVENT_CB_DECLARE(set_cup_four)//声明按键回调
{
	switch (e)
	{
	case LV_EVENT_CLICKED://轻点

		break;
	case LV_EVENT_RELEASED://按压

		break;
	case LV_EVENT_PRESSED://松开

		break;
	case LV_EVENT_LONG_PRESSED://长按

		break;
	default:break;
	}
}

void Sw_Ctrl_Page_Create(void)
{
	//const char* data = "Hello world";
	//lv_obj_t* qr = lv_qrcode_create(lv_scr_act(), 100, lv_color_hex3(0x33f), lv_color_hex3(0xeef));
	//lv_qrcode_update(qr, data, strlen(data));

	//lv_gif_create_from_file(lv_scr_act(), "E:\\01-LV_BMP\\example.gif");

	lv_obj_t* imgbtna = lv_imgbtn_create(lv_scr_act(), NULL);//基于屏幕创建图标
	lv_imgbtn_set_src(imgbtna, LV_BTN_STATE_PRESSED, "0");//按下状态图片
	lv_imgbtn_set_src(imgbtna, LV_BTN_STATE_RELEASED, "0");//抬起状态图片
	lv_imgbtn_set_src(imgbtna, LV_BTN_STATE_CHECKED_RELEASED, "0");//检测到按松开状态图片
	lv_imgbtn_set_src(imgbtna, LV_BTN_STATE_CHECKED_PRESSED, "0");//检测到按下状态图片
	lv_imgbtn_set_checkable(imgbtna, true);//使能按键图片翻转
	lv_imgbtn_toggle(imgbtna);//设置翻转
	lv_obj_align_origo(imgbtna, NULL, LV_ALIGN_IN_TOP_LEFT, 85, 180);//左上角对齐
	lv_obj_set_event_cb(imgbtna, set_cup_four);//设置按钮回调
}
